package com.badibadi.activity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.amap.api.location.AMapLocation;
import com.amap.api.location.AMapLocationListener;
import com.amap.api.location.LocationManagerProxy;
import com.amap.api.location.LocationProviderProxy;
import com.amap.api.location.core.GeoPoint;
import com.amap.api.maps2d.AMap;
import com.amap.api.maps2d.AMap.InfoWindowAdapter;
import com.amap.api.maps2d.AMap.OnInfoWindowClickListener;
import com.amap.api.maps2d.AMap.OnMapClickListener;
import com.amap.api.maps2d.AMap.OnMarkerClickListener;
import com.amap.api.maps2d.CameraUpdateFactory;
import com.amap.api.maps2d.LocationSource;
import com.amap.api.maps2d.MapView;
import com.amap.api.maps2d.model.BitmapDescriptorFactory;
import com.amap.api.maps2d.model.LatLng;
import com.amap.api.maps2d.model.Marker;
import com.amap.api.maps2d.model.MarkerOptions;
import com.amap.api.services.core.LatLonPoint;
import com.amap.api.services.geocoder.GeocodeAddress;
import com.amap.api.services.geocoder.GeocodeQuery;
import com.amap.api.services.geocoder.GeocodeResult;
import com.amap.api.services.geocoder.GeocodeSearch;
import com.amap.api.services.geocoder.GeocodeSearch.OnGeocodeSearchListener;
import com.amap.api.services.geocoder.RegeocodeQuery;
import com.amap.api.services.geocoder.RegeocodeResult;
import com.android.volley.toolbox.NetworkImageView;
import com.badibadi.abcpinying.SortModel;
import com.badibadi.adapter.AddingRecordNewAdapter;
import com.badibadi.adapter.ListTypeAdapter;
import com.badibadi.adapter.Popwindows_Adapter;
import com.badibadi.fragment.BaseFragment;
import com.badibadi.infos.ActivityReadingModel;
import com.badibadi.infos.Area_More_Imgs_Model;
import com.badibadi.infos.BrowseAllPhoto_Model;
import com.badibadi.infos.ListsModel;
import com.badibadi.infos.Results;
import com.badibadi.infos.User;
import com.badibadi.infos.photoImgs_Model;
import com.badibadi.maputil.AMapUtil;
import com.badibadi.maputil.ToastUtil;
import com.badibadi.mytools.AMapUtils;
import com.badibadi.mytools.BitmapHelp;
import com.badibadi.mytools.Constants;
import com.badibadi.mytools.DisplayUtil;
import com.badibadi.mytools.InterestModel;
import com.badibadi.mytools.MyThreadTool;
import com.badibadi.mytools.TabHostUtils;
import com.badibadi.mytools.Utils;
import com.badibadi.mytools.VolleyTools;
import com.badibadi.uniclubber.R;
import com.libjph.util.JsonUtil;
//import com.lidroid.xutils.util.LogUtils;
import com.miloisbadboy.view.PullToRefreshView;
import com.miloisbadboy.view.PullToRefreshView.OnFooterRefreshListener;
import com.miloisbadboy.view.PullToRefreshView.OnHeaderRefreshListener;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.display.RoundedBitmapDisplayer;
import com.view.my_view.XGridView;
import com.view.my_view.XGridView.OnXGridViewListener;

import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable;
import android.location.Location;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Intent;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.TabHost;
import android.widget.TextView;
import android.widget.TabHost.OnTabChangeListener;

@SuppressLint("ValidFragment")
// activity_rigion_pirctue_uppic_setting map imgs
// activity_rigion_pirctue_uppic_settings
// activity_rigion_pirctue_uppic_settings activity_rigion_pirctue_uppic_settings
// activity_rigion_pirctue_uppic_settings
public class RigionPictureActivity extends BaseActivity implements
		OnClickListener {
	protected static final String TAG = "RigionPictureActivity";
	/** 底部三个按钮 **/
	private RelativeLayout bot_btn0, bot_btn1, bot_btn2;
	/** 包括五个按钮，上面两个和下面三个 */
	private int Select_item;

	private TabHost mTabHost;
	private FragmentManager manager;
	private int add_in = -1;
	private TextView activity_rigion_pirctue_tital;

	private FrameLayout layout;

	private RigionPictureFragment01 fragment01;
	private RigionPictureFragment02 fragment02;
	private String areaid;
	private Bundle bundle;
	private boolean img_or_img_biao;

	private List<photoImgs_Model> imgShow_main;
	// BrowseAllPhoto_Model b;
	private List<User> imgUser;
	// private String imgType; //必需）筛选图片类别标签（全部时为0）
	// private DisplayImageOptions options;
	// 接受筛选列表的
	private ListsModel listModel;
	String pageNum = "15";
	public Handler mHandler = new Handler() {
		@Override
		public void handleMessage(Message msg) {
			switch (msg.what) {
			case 1:
//				   ("发送成功:" + msg.getData().getString("tital"));
				activity_rigion_pirctue_tital.setText(msg.getData().getString(
						"tital"));
//				   
				break;
			case 2:// 在这里更新筛选列表
				try {
					initShaiXuanList();
				} catch (Exception e) {
					// TODO: handle exception
				}
//				LogUtils.d("155");
				break;
			case 3:
				break;
			default:
				break;
			}
		}
	};

	/**
	 * 底部的三个按钮
	 */
	private RelativeLayout bottom0, bottom1, bottom2;

	Button saixuananniu;// 筛选按钮
	ListTypeAdapter listAdapter;
	private String imgType = "0";// 筛选的提交数据//全部时为0；

	// activity_rigion_pirctue_tital

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
//		LogUtils.d("177");
		goToTheTitle();
		setContentView(R.layout.activity_rigion_picture);

		init();
		initBottomButton();
		initSaiXuanLieBiao();
	}

	// 更新筛选列表
	protected void initShaiXuanList() {
		// TODO Auto-generated method stub
//		LogUtils.d("191");
		saixuananniu = (Button) this
				.findViewById(R.id.activity_rigion_pirctue_uppic_settings);
		saixuananniu.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {// 全部
				// TODO Auto-generated method stub
				LayoutInflater inflater = LayoutInflater
						.from(RigionPictureActivity.this);
				View root = inflater.inflate(
						R.layout.rigionpicture_shaixuanlist, null);
				ListView type_list = (ListView) root
						.findViewById(R.id.type_list);
				final PopupWindow popup = new PopupWindow(root,
						LinearLayout.LayoutParams.MATCH_PARENT, 360);
				popup.setWidth(LayoutParams.MATCH_PARENT);
				popup.setHeight(LayoutParams.WRAP_CONTENT);
				// Popwindows_Adapter popwindows_Adapter = new
				// Popwindows_Adapter(clueTypeModels,
				// RigionPictureActivity.this);
				listAdapter = new ListTypeAdapter(RigionPictureActivity.this,
						listModel.getLists());
				type_list.setAdapter(listAdapter);
				type_list.setOnItemClickListener(new OnItemClickListener() {

					@Override
					public void onItemClick(AdapterView<?> arg0, View view,
							int position, long arg3) {
						// TODO Auto-generated method stub
						imgShow_main = new ArrayList<photoImgs_Model>();
						imgUser = new ArrayList<User>();

						imgType = "" + listAdapter.getItemId(position);
						saixuananniu.setText(""
								+ ((InterestModel) (listAdapter
										.getItem(position))).getName());

						if (mTabHost.getCurrentTab() == 0) {
							// transaction.replace(R.id.Rigion_picture_layout,
							// fragment01);
							// transaction.commit();asdf
							if (bottom0.isSelected() == true) {
								initFragment_img("1");
							} else if (bottom1.isSelected() == true) {
								initFragment_img("2");
							} else if (bottom2.isSelected() == true) {
								initFragment_img("3");
							}

						} else if (mTabHost.getCurrentTab() == 1) {
							// transaction.replace(R.id.Rigion_picture_layout,
							// fragment02);
							// transaction.commit();
							// initFragment_biao("1");
							if (bottom0.isSelected() == true) {
								initFragment_biao("1");
							} else if (bottom1.isSelected() == true) {
								initFragment_biao("2");
							} else if (bottom2.isSelected() == true) {
								initFragment_biao("3");
							}
						}

						if (popup != null) {
							popup.dismiss();
						}
					}
				});

				popup.setBackgroundDrawable(new BitmapDrawable());
				popup.setFocusable(true);
				popup.setTouchable(true);
				popup.setOutsideTouchable(true);
				popup.showAsDropDown(v);
			}
		});

	}

	/**
	 * 查找对应的类型列表---post
	 * 
	 * @param $type
	 *            ---（必需）查询类型（xingqu:兴趣标签，huodong:活动类型，jilu：记录类型，daren:达人类型，
	 *            julebu:俱乐部类型，tupian:图片标签，jubao:举报类型）
	 * @param $languageType
	 *            ;（必需）//cn_name为中文简体，tw_name 中文繁体 en_name 英文
	 */
	private void initSaiXuanLieBiao() {
//		LogUtils.d("281");
		// TODO Auto-generated method stub
		final String type = "tupian";
		final String languageType = com.badibadi.mytools.Dialog
				.getSystemLanguageType(RigionPictureActivity.this);
		MyThreadTool.fixedThreadPool.execute(new Runnable() {
			@Override
			public void run() {
				Map<String, Object> map = new HashMap<String, Object>();

				map.put("type", type);
				map.put("languageType", languageType);
				String content = Utils.sendRequest(map, Constants.BadiUrl_1
						+ "type/listType");
				//    
				if (content != null) {
					Results results = Utils.checkResult_NNN(
							RigionPictureActivity.this, content);
					if (results != null && !results.getRetmsg().equals("null")) {
//						   
						try {
							listModel = JsonUtil.getEntityByJsonString(
									results.getRetmsg(), ListsModel.class);
							mHandler.sendEmptyMessage(2);
						} catch (Exception e) {
							   
						}
					} else {

						// mHandler.sendEmptyMessage(3);
					}
				} else {

					// mHandler.sendEmptyMessage();
				}
			}
		});

	}

	/**
	 * 初始化底部的
	 */
	private void initBottomButton() {
//		LogUtils.d("325");
		bottom0 = (RelativeLayout) this
				.findViewById(R.id.RigionPicture_bottom_btn1);
		bottom1 = (RelativeLayout) this
				.findViewById(R.id.RigionPicture_bottom_btn2);
		bottom2 = (RelativeLayout) this
				.findViewById(R.id.RigionPicture_bottom_btn3);

		setBottomSelect(0);
		// bot_btn0.setClickable(true);
		bottom0.setOnClickListener(this);
		bottom1.setOnClickListener(this);
		bottom2.setOnClickListener(this);
	}

	/**
	 * 设置底部选中
	 * 
	 * @param num
	 */
	private void setBottomSelect(int num) {
//		LogUtils.d("346");
//		LogUtils.d("num=" + num + "img_or_img_biao" + img_or_img_biao);
		if (num == 0 && bottom0.isSelected() == false) {
			bottom0.setSelected(true);
			bottom1.setSelected(false);
			bottom2.setSelected(false);
			if (img_or_img_biao) {
				initFragment_img("1");
			} else {
				initFragment_biao("1");
			}
		} else if (num == 1 && bottom1.isSelected() == false) {
			bottom0.setSelected(false);
			bottom1.setSelected(true);
			bottom2.setSelected(false);
			if (img_or_img_biao) {
				initFragment_img("2");
			} else {
				initFragment_biao("2");
			}
		} else if (num == 2 && bottom2.isSelected() == false) {
			bottom0.setSelected(false);
			bottom1.setSelected(false);
			bottom2.setSelected(true);
			if (img_or_img_biao) {
				initFragment_img("3");
			} else {
				initFragment_biao("3");
			}
		}
	}

	private void init() {
//		LogUtils.d("378");
		try {
			areaid = getIntent().getStringExtra("areaid");
		} catch (Exception e) {
			   
		}
//		   ("获取到的地方id是:" + areaid);
		activity_rigion_pirctue_tital = (TextView) findViewById(R.id.activity_rigion_pirctue_tital);
		fragment02 = new RigionPictureFragment02();
		layout = (FrameLayout) this.findViewById(R.id.Rigion_picture_layout);
		this.findViewById(R.id.activity_rigion_pirctue_back)
				.setOnClickListener(new OnClickListener() {
					@Override
					public void onClick(View arg0) {
						RigionPictureActivity.this.finish();
					}
				});
		manager = getSupportFragmentManager();
		initFragment_img("1");
		bot_btn1 = (RelativeLayout) this
				.findViewById(R.id.RigionPicture_bottom_btn2);
		bot_btn2 = (RelativeLayout) this
				.findViewById(R.id.RigionPicture_bottom_btn3);

		mTabHost = (TabHost) findViewById(R.id.rigion_picture_tabhost);
		mTabHost.setup();
		mTabHost.addTab(mTabHost
				.newTabSpec("rigion_picture_tabhost one")
				.setIndicator(getResources().getString(R.string.picture),
						getResources().getDrawable(R.drawable.ic_launcher))
				.setContent(R.id.tab1));
		mTabHost.addTab(mTabHost
				.newTabSpec("rigion_picture_tabhost two")
				.setIndicator(getResources().getString(R.string.Icon),
						getResources().getDrawable(R.drawable.ic_launcher))
				.setContent(R.id.tab2));
		TabHostUtils.SetTabHost(this, mTabHost);
		mTabHost.setOnTabChangedListener(new OnTabChangeListener() {

			@Override
			public void onTabChanged(String tabId) {
				FragmentTransaction transaction = manager.beginTransaction();
				switch (mTabHost.getCurrentTab()) {
				case 0:
					if (add_in != 0) {
						// transaction.replace(R.id.Rigion_picture_layout,
						// fragment01);
						// transaction.commit();
						if (bottom0.isSelected() == true) {
							initFragment_img("1");
						} else if (bottom1.isSelected() == true) {
							initFragment_img("2");
						} else if (bottom2.isSelected() == true) {
							initFragment_img("3");
						}
						add_in = 0;
						// initFragment_img("1");
					}
					break;
				case 1:
					if (add_in != 1) {
						// transaction.replace(R.id.Rigion_picture_layout,
						// fragment02);
						// transaction.commit();
						// initFragment_biao("1");
						if (bottom0.isSelected() == true) {
							initFragment_biao("1");
						} else if (bottom1.isSelected() == true) {
							initFragment_biao("2");
						} else if (bottom2.isSelected() == true) {
							initFragment_biao("3");
						}
						add_in = 1;
					}
					break;
				default:
					break;
				}
			}
		});

	}

	private void initFragment_img(String type) {
//		LogUtils.d("446");
//		LogUtils.d("type=" + type + "img_or_img_biao" + img_or_img_biao);
		img_or_img_biao = true;
		FragmentTransaction transaction = manager.beginTransaction();
		fragment01 = new RigionPictureFragment01();
		transaction.replace(R.id.Rigion_picture_layout, fragment01);
		bundle = new Bundle();
		bundle.putString("type", type);
		bundle.putString("showType", "img");
		fragment01.setArguments(bundle);
		transaction.commit();
	}

	private void initFragment_biao(String type) {
//		LogUtils.d("459");
//		LogUtils.d("type=" + type + "img_or_img_biao" + img_or_img_biao);
		img_or_img_biao = false;
		FragmentTransaction transaction = manager.beginTransaction();
		fragment02 = new RigionPictureFragment02();
		transaction.replace(R.id.Rigion_picture_layout, fragment02);
		bundle = new Bundle();
//		LogUtils.d("type=" + type);
		bundle.putString("type", type);
		bundle.putString("showType", "img");
		fragment02.setArguments(bundle);
		transaction.commit();
	}

	// TODO Auto-generated method stub
	// 图片模式
	@SuppressLint("ValidFragment")
	public class RigionPictureFragment01 extends BaseFragment implements
			OnHeaderRefreshListener, OnFooterRefreshListener {
		private PullToRefreshView mPullToRefreshView;
		private GridView gv;
		int addNumber = 9;
		private RigionPicture01Adapter adapter;
		private Results results;
		private String type_temp;
		private int Page;

		private String showType;// 种类
		private Area_More_Imgs_Model area_More_Imgs_Model;

		private boolean judge;
		private Message message;
		private Bundle bundle;
		private Handler handler = new Handler() {
			@Override
			public void handleMessage(Message msg) {
				switch (msg.what) {
				case 1:
//					LogUtils.d("512");
					try {
						Utils.ExitPrgress(RigionPictureActivity.this);
						try {
							Utils.showMessage(
									RigionPictureActivity.this,
									getResources().getString(
											R.string.l_net_error));
						} catch (Exception e) {
							// TODO: handle exception
						}
						mPullToRefreshView.onFooterRefreshComplete();
						mPullToRefreshView.onHeaderRefreshComplete();
					} catch (Exception e) {
						// TODO: handle exception
					}
					break;
				case 2:
					try {
//						LogUtils.d("532");
						Utils.ExitPrgress(RigionPictureActivity.this);
						imgShow_main.addAll(area_More_Imgs_Model.getImg()
								.getImgShow());
						if (area_More_Imgs_Model.getImgUser() != null
								&& !area_More_Imgs_Model.getImgUser().isEmpty()) {
							imgUser.addAll(area_More_Imgs_Model.getImgUser());
						}
						adapter.notifyDataSetChanged();
						if (judge) {
							message = new Message();
							bundle = new Bundle();
							message.what = 1;
							bundle.putString("tital", area_More_Imgs_Model
									.getArea().getArea_name()
									+ "("
									+ area_More_Imgs_Model.getImg()
											.getImgListsCount() + ")");

							message.setData(bundle);
							mHandler.sendMessage(message);
							judge = false;
						}
						mPullToRefreshView.onFooterRefreshComplete();
						mPullToRefreshView.onHeaderRefreshComplete();
					} catch (Exception e) {
						// TODO: handle exception
					}

					break;
				case 3:
//					   
					Utils.ExitPrgress(RigionPictureActivity.this);
					try {
						// if (imgShow_main.isEmpty()) {
						//    
						//    
						// + imgShow_main.size()
						// + "  "
						// + area_More_Imgs_Model.getArea()
						// .getArea_name() + "(" + 0 + ")");
						//    
						// message = new Message();
						// bundle = new Bundle();
						// message.what = 1;
						// bundle.putString("tital", area_More_Imgs_Model
						// .getArea().getArea_name() + "(" + 0 + ")");
						// message.setData(bundle);
						// mHandler.sendMessage(message);
						// } else {
						//    
						// }
						Utils.showMessage(RigionPictureActivity.this,
								getResources().getString(R.string.l_xa10));
					} catch (Exception e) {
						// TODO: handle exception
					}
					mPullToRefreshView.onFooterRefreshComplete();
					mPullToRefreshView.onHeaderRefreshComplete();
					break;
				default:
					break;
				}
			}
		};

		@Override
		public void onCreate(Bundle savedInstanceState) {

//			LogUtils.d("583");
			super.onCreate(savedInstanceState);
		}

		@Override
		public View onCreateView(LayoutInflater inflater, ViewGroup container,
				Bundle savedInstanceState) {
//			LogUtils.d("591");
			View view = inflater.inflate(R.layout.xgridview_1, null);
			type_temp = getArguments().getString("type");
			showType = getArguments().getString("showType");
			// gv = (XGridView) view.findViewById(R.id.xgridView);
//			   ("获取到的显示类型是:" + type_temp);
			Page = 1;
			imgShow_main = new ArrayList<photoImgs_Model>();
			imgUser = new ArrayList<User>();
			mPullToRefreshView = (PullToRefreshView) view
					.findViewById(R.id.main_pull_refresh_view);
			gv = (GridView) view.findViewById(R.id.xgridView11);
			// gv.setXGridViewListener(this);
			gv.setNumColumns(3);
			gv.setHorizontalSpacing(5);
			gv.setVerticalSpacing(5);
			judge = true;
			adapter = new RigionPicture01Adapter(imgShow_main);
			gv.setAdapter(adapter);
			mPullToRefreshView.setOnHeaderRefreshListener(this);
			mPullToRefreshView.setOnFooterRefreshListener(this);

			// Utils.showPrgress(RigionPictureActivity.this);
			imgs(areaid,
					com.badibadi.mytools.Dialog
							.getSystemLanguageType(RigionPictureActivity.this),
					type_temp, imgType, Page, pageNum, showType);
			return view;
		}

		// 1\\
		private void imgs(final String areaid, final String languageType,
				final String type, final String imgType, final int page,
				final String showNum, final String showType) {
//			LogUtils.d("625");
			// Utils.showPrgress(RigionPictureActivity.this);
			MyThreadTool.fixedThreadPool.execute(new Runnable() {
				@Override
				public void run() {
					String content = Utils
							.getRequest(com.badibadi.mytools.Constants.BadiUrl_1
									+ "area/imgs?areaId="
									+ areaid
									+ "&languageType="
									+ languageType
									+ "&type="
									+ type
									+ "&imgType="
									+ imgType
									+ "&page="
									+ page
									+ "&showNum="
									+ showNum
									+ "&uid="
									+ Utils.getUid(RigionPictureActivity.this)
									+ "&showType=" + showType);
//					   
//							"传入的数据是：" + "area/imgs?areaId=" + areaid
//									+ "&languageType=" + languageType
//									+ "&type=" + type + "&imgType=" + imgType
//									+ "&page=" + page + "&showNum=" + showNum
//									+ "&uid="
//									+ Utils.getUid(RigionPictureActivity.this)
//									+ "&showType=" + showType);

					if (content != null) {
						results = Utils.checkResult_NNN(
								getApplicationContext(), content);
//						   
						if (results != null
								&& !results.getRetmsg().equals("null")
								&& results.isRet()) {
							try {
								area_More_Imgs_Model = new Area_More_Imgs_Model();
								area_More_Imgs_Model = JsonUtil
										.getEntityByJsonString(
												results.getRetmsg(),
												Area_More_Imgs_Model.class);
								handler.sendEmptyMessage(2);
								//    ("发送");
							} catch (Exception e) {
								   
							}
						} else {
							if (Page > 1) {
								--Page;
							} else {
								Page = 1;
							}
							handler.sendEmptyMessage(3);
						}
					} else {
						if (Page > 1) {
							--Page;
						} else {
							Page = 1;
						}
						handler.sendEmptyMessage(1);
					}
				}
			});
		}

		class RigionPicture01Adapter extends BaseAdapter {
			// private Area_More_Imgs_Model area_More_Imgs_Model;
			private List<photoImgs_Model> imgShow_m;
			private DisplayImageOptions options;

			public RigionPicture01Adapter(List<photoImgs_Model> imgShow_m) {
				this.imgShow_m = imgShow_m;
//				LogUtils.d("701");
				options = new DisplayImageOptions.Builder()
						.showStubImage(R.drawable.ic_stub)
						.showImageForEmptyUri(R.drawable.noimage)
						.showImageOnFail(R.drawable.noimage).cacheInMemory()
						.cacheOnDisc().displayer(new RoundedBitmapDisplayer(5))
						.build();
			}

			@Override
			public int getCount() {
				try {
					return imgShow_m.size();
				} catch (Exception e) {
					return 0;
				}
			}

			@Override
			public Object getItem(int position) {

				try {
					return imgShow_m.get(position);
				} catch (Exception e) {
					return null;
				}
			}

			@Override
			public long getItemId(int position) {

				try {
					return position;
				} catch (Exception e) {
					return 0;
				}
			}

			@Override
			public View getView(final int position, View convertView,
					ViewGroup parent) {
				//    ("开始加载内容");
				LayoutInflater inflater = LayoutInflater
						.from(getApplicationContext());
				convertView = inflater.inflate(
						R.layout.rigion_prcture_gridview_item, null);
				ImageView rigion_prcture_gridview_img = (ImageView) convertView
						.findViewById(R.id.rigion_prcture_gridview_img);
				rigion_prcture_gridview_img
						.setOnClickListener(new View.OnClickListener() {

							@Override
							public void onClick(View v) {
								// TODO Auto-generated method stub
								Intent intent = new Intent(
										RigionPictureActivity.this,
										PicturePreviewActivity.class);

								List<BrowseAllPhoto_Model> mlist = new ArrayList<BrowseAllPhoto_Model>();

								for (int i = 0; i < imgShow_m.size(); i++) {
									BrowseAllPhoto_Model b = new BrowseAllPhoto_Model();
									b.setId(imgShow_m.get(i).getId());
									b.setPath(imgShow_m.get(i).getPath());
									mlist.add(b);
								}
								intent.putExtra("picture_list",
										(Serializable) mlist);
								intent.putExtra("picture_postion", position);
								startActivity(intent);
							}
						});
				// ImageLoader.getInstance().displayImage(
				// com.badibadi.mytools.Constants.BadiDownImgUrl
				// + imgShow_m.get(position).getPath()
				// + Constants.App9block,
				// rigion_prcture_gridview_img, options);
				new BitmapHelp().displayImage(RigionPictureActivity.this,
						rigion_prcture_gridview_img,
						com.badibadi.mytools.Constants.BadiDownImgUrl
								+ imgShow_m.get(position).getPath()
								+ Constants.App9block);
				return convertView;
			}
		}

		class ViewHolder {
			public ImageView iv;
		}

		@Override
		public void onFooterRefresh(PullToRefreshView view) {
			// Utils.showPrgress(RigionPictureActivity.this);
			imgs(areaid,
					com.badibadi.mytools.Dialog
							.getSystemLanguageType(RigionPictureActivity.this),
					type_temp, imgType, ++Page, pageNum, showType);
		}

		@Override
		public void onHeaderRefresh(PullToRefreshView view) {
			// Utils.showPrgress(RigionPictureActivity.this);
			Page = 1;
			if (imgShow_main != null) {
				imgShow_main.clear();
			}
			imgs(areaid,
					com.badibadi.mytools.Dialog
							.getSystemLanguageType(RigionPictureActivity.this),
					type_temp, "0", Page, pageNum, showType);
		}

	}

	// TODO Auto-generated method stub
	// TODO Auto-generated method stub
	// TODO Auto-generated method stub
	// TODO Auto-generated method stub
	// TODO Auto-generated method stub
	// TODO Auto-generated method stub
	// TODO Auto-generated method stub
	// TODO Auto-generated method stub
	// TODO Auto-generated method stub
	// TODO Auto-generated method stub
	// TODO Auto-generated method stub
	// TODO Auto-generated method stub
	// TODO Auto-generated method stub
	// 图标模式
	@SuppressLint("ValidFragment")
	public class RigionPictureFragment02 extends BaseFragment implements
			OnClickListener, LocationSource, AMapLocationListener,
			OnGeocodeSearchListener, OnMapClickListener, OnMarkerClickListener,
			OnInfoWindowClickListener, InfoWindowAdapter {

		// 下面是地图的
		private AMap aMap;
		private MapView mapView;
		private OnLocationChangedListener mListener;
		private LocationManagerProxy mAMapLocationManager;
		private GeoPoint geoPoint;
		private boolean isFirstCallBack = true;// 是否为第一次回调

		// 发源地

		private ProgressDialog progDialog = null;
		private GeocodeSearch geocoderSearch;
		private Marker geoMarker;
		private Marker regeoMarker;

		// 这里保存要上传的地址名
		private String addressName;
		// 这里保存要上传的经纬度
		private LatLonPoint latLonPoint = new LatLonPoint(40.003662, 116.465271);

		// 下面的是图标模式的:所有头像
		LinearLayout ll_picture_from;
		LinearLayout linear_ying_xian;// 当type_temp=3时，隐藏其余显示
		private String type_temp;// 显示类别 全部："1", 朋友："2", 自己:"3"

		private Area_More_Imgs_Model area_More_Imgs_Model;

		// 地图上画东西
		AMap aMap_;
		int i_;
		LatLng latlng_;
		private Handler handler = new Handler() {
			@Override
			public void handleMessage(Message msg) {
				switch (msg.what) {
				case 1:
//					LogUtils.d("863");
					Utils.ExitPrgress(RigionPictureActivity.this);
					try {
						Utils.showMessage(RigionPictureActivity.this,
								getResources().getString(R.string.l_net_error));
					} catch (Exception e) {
						// TODO: handle exception
					}
					break;
				case 2:
					try {
//						LogUtils.d("875");
						Utils.ExitPrgress(RigionPictureActivity.this);
						imgShow_main.addAll(area_More_Imgs_Model.getImg()
								.getImgShow());
						if (area_More_Imgs_Model.getImgUser() != null
								&& !area_More_Imgs_Model.getImgUser().isEmpty()) {
							imgUser.addAll(area_More_Imgs_Model.getImgUser());
						}
						try {
							initData();
						} catch (Exception e) {
							// TODO: handle exception
						}
						Message msgs = new Message();
						msgs.what = 1;
						bundle = new Bundle();
						bundle.putString("tital", area_More_Imgs_Model
								.getArea().getArea_name()
								+ "("
								+ area_More_Imgs_Model.getImg()
										.getImgListsCount() + ")");
						msgs.setData(bundle);

						mHandler.sendMessage(msgs);
					} catch (Exception e) {
						// TODO: handle exception
					}

					//    
					// activity_rigion_pirctue_tital.setText(msg.getData().getString(
					// "tital"));
					// if (judge) {
					// message = new Message();
					// bundle = new Bundle();
					// message.what = 1;
					// bundle.putString("tital", area_More_Imgs_Model
					// .getArea().getArea_name()
					// + "("
					// + area_More_Imgs_Model.getImg()
					// .getImgListsCount() + ")");
					//
					// message.setData(bundle);
					// mHandler.sendMessage(message);
					// judge = false;
					// }

					// adapter.notifyDataSetInvalidated();

					break;
				case 3:
					Utils.ExitPrgress(RigionPictureActivity.this);
					try {
//						LogUtils.d("927");
						Utils.showMessage(RigionPictureActivity.this,
								getResources().getString(R.string.l_xa10));
					} catch (Exception e) {
						// TODO: handle exception
					}
				case 4:// 画图标
					Utils.ExitPrgress(RigionPictureActivity.this);
					try {
//						LogUtils.d("936");
						if (i_ == 0) {
							try {
								LatLng latlng = new LatLng(
										Double.parseDouble(imgShow_main.get(0)
												.getMap_x()),
										Double.parseDouble(imgShow_main.get(0)
												.getMap_y()));
								AMapUtils.CameraMoveTo(aMap, latlng);
							} catch (Exception e) {
								// TODO: handle exception
							}
						}
						AMapUtils.drawMarker(aMap_, "" + i_, "", latlng_);
					} catch (Exception e) {
						// TODO: handle exception
					}
					break;
				case 5:

					break;

				default:
					break;
				}
			}
		};

		@Override
		public void onCreate(Bundle savedInstanceState) {
			super.onCreate(savedInstanceState);
			imgShow_main = new ArrayList<photoImgs_Model>();
			imgUser = new ArrayList<User>();
//			LogUtils.d("969");
		}

		@Override
		// ll_picture_from
		public View onCreateView(LayoutInflater inflater, ViewGroup container,
				Bundle savedInstanceState) {
//			LogUtils.d("976");
			View view = inflater.inflate(R.layout.rigion_tubiao, null);
			mapView = (MapView) view.findViewById(R.id.map);
			mapView.onCreate(savedInstanceState);// 此方法必须重写
			type_temp = getArguments().getString("type");
			initMapView();
			initViewID(view);

			imgs(areaid,
					com.badibadi.mytools.Dialog
							.getSystemLanguageType(RigionPictureActivity.this),
					type_temp, imgType, 1, "500", "img");//
			return view;
		}

		private void initData() {
			// TODO Auto-generated method stub
//			LogUtils.d("993");
			if (ll_picture_from != null) {
				ll_picture_from.setGravity(Gravity.CENTER_VERTICAL
						| Gravity.CENTER_HORIZONTAL);
			}
			if (imgUser != null) {
				for (int i = 0; i < imgUser.size(); i++) {
					addHead(ll_picture_from, i);
				}
			}
			if (imgShow_main != null)// imgShow_main
			{
				new Thread(new Runnable() {

					@Override
					public void run() {
						// TODO Auto-generated method stub
						for (int i = 0; i < imgShow_main.size(); i++) {
							// if(imgShow_main.get(i)!=null)
							LatLng latlng = new LatLng(
									Double.parseDouble(imgShow_main.get(i)
											.getMap_x()),
									Double.parseDouble(imgShow_main.get(i)
											.getMap_y()));

							aMap_ = aMap;
							i_ = i;
							latlng_ = latlng;
							handler.sendEmptyMessageAtTime(4, 300);
							// if (i != 0) {
							// LatLng latlng2 = new LatLng(
							// Double.parseDouble(imgShow_main.get(i - 1)
							// .getMap_x()),
							// Double.parseDouble(imgShow_main.get(i - 1)
							// .getMap_y()));
							// AMapUtils.drawLine(aMap, latlng, latlng2,
							// Color.RED);
							// }

						}
						try {
							handler.sendEmptyMessage(5);

						} catch (Exception e) {
							// TODO: handle exception
						}
					}
				}).start();

			}

		}

		/**
		 * 添加头像
		 */
		public void addHead(LinearLayout ll, final int pos) {
//			LogUtils.d("1050");
			LayoutInflater inflater = LayoutInflater
					.from(RigionPictureActivity.this);
			View v = inflater.inflate(R.layout.aah, null);
			v.setPadding(DisplayUtil.dip2px(getActivity(), 1), 0,
					DisplayUtil.dip2px(getActivity(), 1), 0);
			ImageView iv_head = (ImageView) v.findViewById(R.id.aah);
			if (imgUser.get(pos).getHead() != null) {
				/* ImageLoader.getInstance().displayImage(
			 Constants.BadiDownImgUrl + "/" + imgUser.get(pos).getHead()
				 + Constants.appPhoto4img, iv_head, options);*/
				new BitmapHelp().displayImage(getActivity(), iv_head,
						Constants.BadiDownImgUrl + "/"
								+ imgUser.get(pos).getHead()
								+ Constants.appPhoto4img);
			} else if (imgUser.get(pos).getPath() != null) {
				// ImageLoader.getInstance().displayImage(
				// Constants.BadiDownImgUrl + "/" + imgUser.get(pos).getPath()
				// + Constants.appPhoto4img, iv_head, options);
				new BitmapHelp().displayImage(getActivity(), iv_head,
						Constants.BadiDownImgUrl + "/"
								+ imgUser.get(pos).getPath()
								+ Constants.appPhoto4img);
			}
			iv_head.setOnClickListener(new OnClickListener() {

				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub
					Intent intent = new Intent(RigionPictureActivity.this,
							SeeOtherPeopleSpaceActivity.class);
					intent.putExtra("friend_id", imgUser.get(pos).getId());
					startActivity(intent);
				}
			});

			// LogUtils.d("我是打印的头像=" + Constants.BadiDownImgUrl + "/"
			// + imgUser.get(pos).getHead() + Constants.appPhoto4img);
			ll.addView(v);

		}

		public void ViewHolder() {

		}

		// 初始化id
		private void initViewID(View view) {

			ll_picture_from = (LinearLayout) view
					.findViewById(R.id.ll_picture_from);
			linear_ying_xian = (LinearLayout) view
					.findViewById(R.id.linear_ying_xian);
			if (type_temp.equals("3")) {
				linear_ying_xian.setVisibility(View.GONE);
			} else {
				linear_ying_xian.setVisibility(View.VISIBLE);
			}
		}

		private void initMapView() {
			progDialog = new ProgressDialog(getActivity());
			geocoderSearch = new GeocodeSearch(getActivity());
			geocoderSearch.setOnGeocodeSearchListener(this);
//			LogUtils.d("1081");
			if (aMap == null) {
				aMap = mapView.getMap();
				//
				// geoMarker = aMap
				// .addMarker(new MarkerOptions()
				// .anchor(0.5f, 0.5f)
				// .icon(BitmapDescriptorFactory
				// .defaultMarker(BitmapDescriptorFactory.HUE_BLUE)));
				// regeoMarker = aMap
				// .addMarker(new MarkerOptions()
				// .anchor(0.5f, 0.5f)
				// .icon(BitmapDescriptorFactory
				// .defaultMarker(BitmapDescriptorFactory.HUE_RED)));
				setUpMap();
			}
		}

		private void setUpMap() {
//			LogUtils.d("1100");
			aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(
					Constants.CHENGDU, 12));// 设置指定的可视区域地图
			// aMap.setMyLocationStyle(myLocationStyle);
			// aMap.setOnMapClickListener(this);// 点击地图上的
			// aMap.setLocationSource(this);// 设置定位监听
			// aMap.getUiSettings().setMyLocationButtonEnabled(true);//
			// 设置默认定位按钮是否显示
			aMap.setMyLocationEnabled(true);// 设置为true表示显示定位层并可触发定位，false表示隐藏定位层并不可触发定位，默认是false
			aMap.setInfoWindowAdapter(this);// 设置自定义InfoWindow样式
			aMap.setOnMarkerClickListener(this);// 设置点击marker事件监听器

		}

		/**
		 * 方法必须重写
		 */
		@Override
		public void onResume() {
			super.onResume();
			mapView.onResume();
		}

		/**
		 * 方法必须重写
		 */
		@Override
		public void onPause() {
			super.onPause();
			mapView.onPause();
			deactivate();
		}

		/**
		 * 方法必须重写
		 */
		@Override
		public void onSaveInstanceState(Bundle outState) {
			super.onSaveInstanceState(outState);
			mapView.onSaveInstanceState(outState);
		}

		/**
		 * 方法必须重写
		 */
		@Override
		public void onDestroy() {
			super.onDestroy();
			mapView.onDestroy();
			//改
			BitmapHelp.clearAll();
		}

		@Override
		public void onLocationChanged(Location location) {
		}

		@Override
		public void onProviderDisabled(String provider) {

		}

		@Override
		public void onProviderEnabled(String provider) {

		}

		@Override
		public void onStatusChanged(String provider, int status, Bundle extras) {

		}

		// 点击地图的上东西后回调
		@Override
		public void onMapClick(LatLng latlng) {
			// if (aMap != null && latlng != null) {
			// aMap.clear();
			// // MarkerOptions markerOptions=new MarkerOptions();
			// // markerOptions.
			//
			// geoMarker = aMap
			// .addMarker(new MarkerOptions()
			// .anchor(0.5f, 0.5f)
			// .icon(BitmapDescriptorFactory
			// .defaultMarker(BitmapDescriptorFactory.HUE_BLUE)));
			// // aMap.addMarker(new MarkerOptions());
			// geoMarker.setPosition(latlng);
			// getAddress(AMapUtil.convertToLatLonPoint(latlng));
			// aMap.invalidate();
			// latLonPoint = AMapUtil.convertToLatLonPoint(latlng);
			//    
			// "address+====>" + addressName + " latLonPoint--->"
			// + latLonPoint.getLatitude() + ","
			// + latLonPoint.getLongitude());
			//
			// }
		}

		/**
		 * 地理编码查询回调
		 */
		@Override
		public void onGeocodeSearched(GeocodeResult result, int rCode) {

			dismissDialog();
			if (rCode == 0) {
				if (result != null && result.getGeocodeAddressList() != null
						&& result.getGeocodeAddressList().size() > 0) {
					GeocodeAddress address = result.getGeocodeAddressList()
							.get(0);
					aMap.animateCamera(CameraUpdateFactory.newLatLngZoom(
							AMapUtil.convertToLatLng(address.getLatLonPoint()),
							15));
					geoMarker.setPosition(AMapUtil.convertToLatLng(address
							.getLatLonPoint()));
					addressName = getResources().getString(R.string.l_xb97)
							+ address.getLatLonPoint() + "\n"
							+ getResources().getString(R.string.l_xb98)
							+ address.getFormatAddress();
					// 这里保存要上传的经纬度
					latLonPoint = address.getLatLonPoint();
//					   
//							+ "///" + latLonPoint.getLongitude());

					ShowToast(getActivity(), addressName);
				} else {
					ToastUtil.show(getActivity(), R.string.no_result);
				}

			} else if (rCode == 27) {
				ToastUtil.show(getActivity(), R.string.error_network);
			} else if (rCode == 32) {
				ToastUtil.show(getActivity(), R.string.error_key);
			} else {
				ToastUtil.show(getActivity(), getString(R.string.error_other)
						+ rCode);
			}
		}

		// /**
		// * 逆地理编码回调
		// */
		@Override
		public void onRegeocodeSearched(RegeocodeResult result, int rCode) {
			dismissDialog();
			if (rCode == 0) {
				if (result != null
						&& result.getRegeocodeAddress() != null
						&& result.getRegeocodeAddress().getFormatAddress() != null) {
					addressName = result.getRegeocodeAddress()
							.getFormatAddress()
							+ getResources().getString(R.string.l_xb99);
					// if(addressName!="" &&
					// searchText.getText().toString().trim()!="")
					// {
					// searchText.setText(""+result.getRegeocodeAddress().getFormatAddress());
					// }
					// aMap.animateCamera(CameraUpdateFactory.newLatLngZoom(
					// AMapUtil.convertToLatLng(latLonPoint), 15));
					regeoMarker.setPosition(AMapUtil
							.convertToLatLng(latLonPoint));
					try {
						ToastUtil.show(getActivity(), addressName);
					} catch (Exception e) {
					}

				} else {
					ToastUtil.show(getActivity(), R.string.no_result);
				}
			} else if (rCode == 27) {
				ToastUtil.show(getActivity(), R.string.error_network);
			} else if (rCode == 32) {
				ToastUtil.show(getActivity(), R.string.error_key);
			} else {
				ToastUtil.show(getActivity(), getString(R.string.error_other)
						+ rCode);
			}
		}

		/**
		 * 隐藏进度条对话框
		 */
		public void dismissDialog() {
			if (progDialog != null) {
				progDialog.dismiss();
			}
		}

		/**
		 * 定位成功后回调函数
		 */
		@Override
		public void onLocationChanged(AMapLocation aLocation) {
			//    

			// if (mListener != null && aLocation != null) {
			//
			// //    
			// //
			// "aLocation.getLatitude()--->"+aLocation.getLatitude()+"  aLocation.getLongitude()===>"+aLocation.getLongitude());
			// mListener.onLocationChanged(aLocation);// 显示系统小蓝点
			//
			// // geoPoint=new GeoPoint((int) (aLocation.getLatitude() * 1E6),
			// // (int) (aLocation.getLongitude() * 1E6));
			// // //用给定的经纬度构造一个GeoPoint，单位是微度 (度 * 1E6)
			// // CameraUpdateFactory a=CameraUpdateFactory.newLatLngZoom(new
			// // LatLng(arg0, arg1), arg1)
			//
			// if (isFirstCallBack == true) {
			// aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(
			// new LatLng(aLocation.getLatitude(), aLocation
			// .getLongitude()), 12));// 设置指定的可视区域地图
			// isFirstCallBack = false;
			// latLonPoint = new LatLonPoint(aLocation.getLatitude(),
			// aLocation.getLongitude());
			// getAddress(new LatLonPoint(aLocation.getLatitude(),
			// aLocation.getLongitude()));
			// }
			// }
		}

		/**
		 * 激活定位
		 */
		@Override
		public void activate(OnLocationChangedListener listener) {
			mListener = listener;
			if (mAMapLocationManager == null) {
				mAMapLocationManager = LocationManagerProxy
						.getInstance(getActivity());
				/*
				 * mAMapLocManager.setGpsEnable(false);
				 * 1.0.2版本新增方法，设置true表示混合定位中包含gps定位，false表示纯网络定位，默认是true
				 * Location API定位采用GPS和网络混合定位方式
				 * ，第一个参数是定位provider，第二个参数时间最短是2000毫秒，第三个参数距离间隔单位是米，第四个参数是定位监听者
				 */
				mAMapLocationManager.requestLocationUpdates(
						LocationProviderProxy.AMapNetwork, 2000, 10, this);
			}
		}

		/**
		 * 停止定位
		 */
		@Override
		public void deactivate() {
			mListener = null;
			if (mAMapLocationManager != null) {
				mAMapLocationManager.removeUpdates(this);
				mAMapLocationManager.destory();
			}
			mAMapLocationManager = null;
		}

		/**
		 * 显示进度条对话框
		 */
		public void showDialog() {
			progDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
			progDialog.setIndeterminate(false);
			progDialog.setCancelable(true);
			progDialog.setMessage("正在获取地址");
			progDialog.show();
		}

		/**
		 * 响应逆地理编码
		 */
		public void getAddress(final LatLonPoint latLonPoint) {
			showDialog();
			RegeocodeQuery query = new RegeocodeQuery(latLonPoint, 200,
					GeocodeSearch.AMAP);// 第一个参数表示一个Latlng，第二参数表示范围多少米，第三个参数表示是火系坐标系还是GPS原生坐标系
			geocoderSearch.getFromLocationAsyn(query);// 设置同步逆地理编码请求
		}

		/**
		 * 响应地理编码
		 */
		public void getLatlon(final String name) {
			showDialog();
			GeocodeQuery query = new GeocodeQuery(name, null);// 第一个参数表示地址，第二个参数表示查询城市，中文或者中文全拼，citycode、adcode，
			geocoderSearch.getFromLocationNameAsyn(query);// 设置同步地理编码请求
		}

		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub

		}

		@Override
		public View getInfoContents(Marker arg0) {
			// TODO Auto-generated method stub
			return null;
		}

		@Override
		public View getInfoWindow(Marker marker) {
			// TODO Auto-generated method stub
			// TODO Auto-generated method stub
			View infoWindow = getActivity().getLayoutInflater().inflate(
					R.layout.custom_info_window, null);

			render(marker, infoWindow);
			return infoWindow;
		}

		private void render(Marker marker, View view) {
			// TODO Auto-generated method stub
			ImageView img = (ImageView) view.findViewById(R.id.img);
			String p = marker.getTitle();
			//    
			int pos = Integer.parseInt(marker.getTitle().toString());
			try {
				// VolleyTools.displayImageByNetworkImageView(getActivity(),
				// Constants.BadiDownImgUrl + "/"
				// + imgShow_main.get(pos).getPath(), img);
				// ImageLoader.getInstance()
				// .displayImage(
				// Constants.BadiDownImgUrl + "/"
				// + imgShow_main.get(pos).getPath(), img,
				// options);
				new BitmapHelp().displayImage(getActivity(), img,
						Constants.BadiDownImgUrl + "/"
								+ imgShow_main.get(pos).getPath()
								+ Constants.AppmomentImg);
			} catch (Exception e) {
				// TODO: handle exception
			}
			// // 数量
			TextView imgNum = (TextView) view.findViewById(R.id.imgNum);
			imgNum.setText("");
			// + imgShow_main.get(pos).getImg_show()
			// .getImgNum());
			// 地址
			TextView address = (TextView) view.findViewById(R.id.address);
			address.setText("" + imgShow_main.get(pos).getAddress());
			// 内容
			TextView info = (TextView) view.findViewById(R.id.info);
			info.setText("" + imgShow_main.get(pos).getAttachment());

			// title
			TextView title = (TextView) view.findViewById(R.id.title);
			title.setText("" + imgShow_main.get(pos).getTitle());

		}

		@Override
		public void onInfoWindowClick(Marker arg0) {
			// TODO Auto-generated method stub

		}

		@Override
		public boolean onMarkerClick(Marker arg0) {
			// TODO Auto-generated method stub
			return false;
		}

		/**
		 * 1 地区图片列表(全部)----get
		 * 
		 * @param $areaId
		 *            ----（必需）地区ID
		 * @param $languageType
		 *            ;（必需）//cn_name为中文简体，tw_name 中文繁体 en_name 英文
		 * @param $type
		 *            -------显示类型全部："1", 朋友："2", 自己:"3"
		 * @param $imgType
		 *            -------（必需）筛选图片类别标签（全部时为0）
		 * @param $showType
		 *            ----查询模式：'img':图片模式，'map':地区模式
		 * @param $page
		 *            ;（必需）//第几页
		 * @param $showNum
		 *            ;（必需）//每页显示的数量
		 */
		private void imgs(final String areaid, final String languageType,
				final String type, final String imgType, final int page,
				final String showNum, final String showType) {
//			LogUtils.d("1473");
			// Utils.showPrgress(RigionPictureActivity.this);
			MyThreadTool.fixedThreadPool.execute(new Runnable() {
				@Override
				public void run() {
					String content = Utils
							.getRequest(com.badibadi.mytools.Constants.BadiUrl_1
									+ "area/imgs?areaId="
									+ areaid
									+ "&languageType="
									+ languageType
									+ "&type="
									+ type
									+ "&imgType="
									+ imgType
									+ "&page="
									+ page
									+ "&showNum="
									+ showNum
									+ "&uid="
									+ Utils.getUid(RigionPictureActivity.this)
									+ "&showType=" + showType);
//					   
//							"地区图片图标模式上传数据:" + "area/imgs?areaId=" + areaid
//									+ "&languageType=" + languageType
//									+ "&type=" + type + "&imgType=" + imgType
//									+ "&page=" + page + "&showNum=" + showNum
//									+ "&uid="
//									+ Utils.getUid(RigionPictureActivity.this)
//									+ "&showType=" + showType);
					if (content != null) {
						Results results = Utils.checkResult_NNN(
								getApplicationContext(), content);
//						   
						if (results != null
								&& !results.getRetmsg().equals("null")
								&& results.isRet()) {
//							   ("地区图片:" + results.getRetmsg());
							try {
								area_More_Imgs_Model = new Area_More_Imgs_Model();
								area_More_Imgs_Model = JsonUtil
										.getEntityByJsonString(
												results.getRetmsg(),
												Area_More_Imgs_Model.class);
								handler.sendEmptyMessage(2);
								//    ("发送");
							} catch (Exception e) {
								   
							}
						} else {
							handler.sendEmptyMessage(3);
						}
					} else {

						handler.sendEmptyMessage(1);
					}
				}
			});
		}
	}

	@Override
	public void onClick(View v) {

		switch (v.getId()) {
		case R.id.RigionPicture_bottom_btn1:
			setBottomSelect(0);
			break;
		case R.id.RigionPicture_bottom_btn2:
			setBottomSelect(1);
			break;
		case R.id.RigionPicture_bottom_btn3:
			setBottomSelect(2);
			break;
		}
	}
}
